package controller;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import view.PanelSystem;

public class SystemController implements ActionListener, MouseListener {
	private PanelSystem panel;

	public SystemController(PanelSystem panel) {
		this.panel = panel;
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		String cmd = e.getActionCommand();
		switch (cmd) {
		case "show":// used by add button
			panel.showAddPanel();
			panel.getA_username().requestFocus();
			break;
		case "add":// used by add menu
			panel.setVisibleAddPanel();
			panel.getA_username().requestFocus();
			break;
		case "notify":// used by notify menu
			panel.showNotifyPanel();
			break;
		}
	}

	@Override
	public void mouseClicked(MouseEvent e) {

	}

	@Override
	public void mousePressed(MouseEvent e) {
		panel.showAdvancedFind();

	}

	@Override
	public void mouseReleased(MouseEvent e) {
		panel.showPopupMenu(e);

	}

	@Override
	public void mouseEntered(MouseEvent e) {

	}

	@Override
	public void mouseExited(MouseEvent e) {

	}

}
